<?php
$lang_path="";
$config_lang="english";
$posttext="";
$define_links='0';
$link_new_account = 'index.php?option=registration&amp;task=register';
$link_lost_password = 'index.php?option=registration&amp;task=lostPassword';
		
// load language file
$basePath = dirname(__file__);
$lang_path = $basePath . '/login_languages/' . $config_lang .'.php';
$lang_path_default = $basePath . '/login_languages/english.php';

if (file_exists($lang_path)) {
    require_once ($lang_path);
} else {
    require_once ($lang_path_default);
}
?>
<script type="text/javascript">
	function checkMail(x){
		return true;
		var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
		if (filter.test(x)){ document.loginForm.submit(); }
		else{ alert('\nInvalid entry!\nYou must enter a valid email address format "name@domain.dom".'); return false; }
	}
</script>
<style type="text/css">
#main {
	position:relative;
	min-height:450px!important;
	_height:450px;
}

html>body #main {
	height: auto;
	min-height: 450px;
}
</style>
<div align="center">
  <div class="mod_login" align="center">
  	<div class="mod_login_content_body">
      <form action="<?php echo $_SERVER["SCRIPT_NAME"];?>" method="post" name="loginForm">
        <table width="100%" border="0" align="center" cellspacing="5" cellpadding="5">
          <tr>
            <td align="center" width="100">
			<img src="img/logo_users.jpg" alt="users babili" />
			</td>
			<td>
			<table cellspacing="15"><tr><td for="mod_login_username" class="mod_login_label_username" align="right"><?php echo _EMAIL; ?></td><td>
              <input type="text" name="username" id="mod_login_username" class="inputbox" alt="username" size="20" />
              </td></tr><tr><td for="mod_login_password" class="mod_login_label_password" align="right"><?php echo _PASSWORD; ?></td><td>
              <input type="password" id="mod_login_password" name="passwd" class="inputbox" size="20" alt="password" />
              </td></tr><tr><td for="mod_login_project" align="right"><?php echo _PRODUCT; ?>
              </td><td>
			  <select id="product" name="product">
			  <?php
				foreach($resultProducts as $product){
					echo "<option value=\"".$product['id']."\" >".$product['label']."</option>";
				}
			  ?>
			  </select>
              </td></tr></table>
		 </td><tr><td class="mod_login_form_submit" align="center" colspan="2">              
			 <input type="submit" name="Submit" onclick="javascript: if(checkMail(document.loginForm.username.value)==true)return true; else return false;" class="mod_login_submit_button" title="<?php echo _BUTTON_LOGIN; ?>" value="Login" style="width:70px; padding-left:30px;" />
		 </td>
        </tr>
		<tr>
		 <td>
		 	
		 </td>
		</tr>
      </table>
 	  
	  <div class="register">
		<a href="<?php echo $link_new_account; ?>" class="c_register"><?=_REGISTER?></a> | <a href="<?php echo $link_lost_password; ?>" class="l_password"><?=_LOST_YOUR_PASSWORD?></a>
	  </div>
	  <br />
	  
      <input type="hidden" name="lang" value="<?php echo $config_lang; ?>" />
      <input type="hidden" name="<?php echo $validate; ?>" value="1" />
    </form>
	<?=BABILI_AUTH_GUIDE?>
  </div>
 </div>
</div>